Card=class("Card");

function Card:ctor(obj, paiId)
    self.gameObject=obj;
    self.transform=obj.transform;
    self.paiId = paiId;
    self.color = tonumber(string.sub(paiId,1,1));
    self.num = tonumber(string.sub(paiId,3));
    if(self.num==1 or self.num==2)then
        self.num = self.num + 13;
    end

    self.numImg = self.transform:Find("num"):GetComponent("UISprite");
    self.colorImg=self.transform:Find("color"):GetComponent("UISprite")
    self.panel=self.transform:GetComponent("UIPanel")

    --nil..string 不报错，但是有错不执行
    self.numImg.spriteName="card_"..self.paiId;
    self.colorImg.spriteName="color_"..self.color;

    GamePanel.behaviour:AddClick(self.gameObject,self.OnClick,self);

    self.shoot=false;
end
--点击牌
function Card:OnClick(go)
    if(self.shoot)then
        self.shoot=false;
        self.transform.localPosition=self.transform.localPosition-Vector3(0,50);--放下
    else
        self.shoot=true;--
        self.transform.localPosition=self.transform.localPosition+Vector3(0,50);--提起
    end
end